{extend name="common/base"/}
{block name="style"}
<style>
    .layui-table td{
        /*表头内容居中显示*/
        text-align: center;
    }
    .layui-tree-entry{font-size:15px; line-height:24px}
    .layui-tree-set{padding:2px 0}
    .layui-tree-iconClick .layui-icon{color:#1E9FFF}
    .layui-icon layui-icon-file{font-size:16px;}
    .layui-tree-icon {height: 14px;line-height: 14px; width: 14px; text-align: center;border: 1px solid #1E9FFF; color:#1E9FFF}
    .layui-tree-line .layui-tree-set .layui-tree-set:after{top:18px;}
    .tree-left{width:200px; float:left; height:calc(100% - 30px); overflow: scroll; border:1px solid #eeeeee; background-color:#FAFAFA; padding:12px 12px 12px 5px;}
    .tree-left h3{font-size:16px; height:30px; padding-left:10px; font-weight:800}

    .gougu-upload-files{background-color: #ffffff; border:1px solid #e4e7ed;color: #c0c4cc;cursor: not-allowed; padding:0 12px; width:180px; box-sizing: border-box; display: inline-block; font-size: inherit; height: 38px; line-height: 35px; margin-right:8px; border-radius:2px;}
    .gougu-upload-tips{color:#969696}
    .layui-form-item{margin-bottom:8px;}
    .layui-input-block{min-height:24px;}
    .u-b-flex{display:flex;flex-direction: column;justify-content: center;align-content: center;
        height: 368px;}
    .l-pd-t{margin:20px 0 0 0 !important;}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="p-3">


    <div class="layui-row layui-col-space10">

        <div class="layui-col-md5">

            <div class="layui-form gg-form-bar border-t border-x">

                <div class="layui-input-inline" style="width:300px;">
                    基因组质控品标称值的标准不确定度
                </div>
            </div>
            <table class="layui-table layui-table-form">

                <tr>
                    <td class="layui-td-gray-2">DNA</td>
                    <td >1</td>
                    <td>2</td>
                    <td>3</td>
                </tr>
                <tr>
                    <td class="layui-td-gray-2">转基因DNA</td>
                    <td><input type="text" id="data1"  name="data1"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                    <td><input type="text" id="data2"  name="data2"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                    <td><input type="text" id="data3"  name="data3"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                </tr>
                <tr>
                    <td class="layui-td-gray-2">非转基因DNA</td>
                    <td><input type="text" id="sdata1"  name="sdata1"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                    <td><input type="text" id="sdata2"  name="sdata2"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                    <td ><input type="text" id="sdata3"  name="sdata3"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                </tr>
            </table>

            <div class="top20">&nbsp;</div>
            <table class="layui-table layui-table-form">
                <tr>
                    <td class="layui-td-gray-2">转基因DNA体积<font>*</font></td>
                    <td colspan="2">
                        <input type="text" id="cdata1"  name="cdata1"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                </tr>
                <tr>
                    <td class="layui-td-gray-2">非转基因DNA体积<font>*</font></td>
                    <td colspan="2">
                        <input type="text" id="cdata2"  name="cdata2"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                </tr>
                <tr>
                    <td class="layui-td-gray-2">200 uL移液器的不确定度<font>*</font></td>
                    <td colspan="2">
                        <input type="text" id="cdata3" name="cdata3"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                </tr>
                <tr>
                    <td class="layui-td-gray-2">1000 uL移液器的不确定度<font>*</font></td>
                    <td colspan="2">
                        <input type="text" id="cdata4" name="cdata4"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                </tr>
                <tr>
                    <td class="layui-td-gray-2">基因组DNA质控品标称值<font>*</font></td>
                    <td colspan="2">
                        <input type="text" id="cdata5" name="cdata5"  lay-verify="required" placeholder="请输入"  class="layui-input" value="" >
                    </td>
                </tr>
            </table>

            <div class="top20">&nbsp;</div>
            <div class="layui-form gg-form-bar border-t border-x">

                <div class="layui-input-inline" style="width:300px;">
                    阳性定量质控品检测数据平均值的标准不确定度
                </div>
            </div>
            <table class="layui-table layui-table-form">
                <tr>
                    <td class="layui-td-gray-2">重复1<font>*</font></td>
                    <td colspan="2">
                        <input type="text" id="tdata1"  name="tdata1"  lay-verify="required" placeholder="请输入重复1"  class="layui-input" value="" >
                    </td>
                </tr>
                <tr>
                    <td class="layui-td-gray-2">重复2<font>*</font></td>
                    <td colspan="2">
                        <input type="text" id="tdata2"  name="tdata2"  lay-verify="required" placeholder="请输入重复2"  class="layui-input" value="" >
                    </td>
                </tr>
                <tr>
                    <td class="layui-td-gray-2">重复3<font>*</font></td>
                    <td colspan="2">
                        <input type="text" id="tdata3" name="tdata3"  lay-verify="required" placeholder="请输入重复3"  class="layui-input" value="" >
                    </td>
                </tr>
                <tr>
                    <td class="layui-td-gray-2">标称值<font>*</font></td>
                    <td colspan="2">
                        <input type="text" id="bcz" name="bcz"  lay-verify="required" placeholder="请输入标称值"  class="layui-input" value="" >
                    </td>
                </tr>
            </table>
        </div>
        <div class="layui-col-md2 u-b-flex">

            <button class="layui-btn layui-btn-normal" name="reset"><i class="layui-icon">&#xe66f;</i>重置</button>

            <button class="layui-btn layui-btn-normal l-pd-t" name="start_jisuan"><i class="layui-icon">&#xe66f;</i>开始计算</button>

        </div>
        <div class="layui-col-md5">
            <button class="layui-btn layui-btn-normal" style="margin-bottom: 20px" name="export_data"><i class="layui-icon">&#xe66f;</i>导出</button>

            <div id="results"></div>
        </div>
    </div>

</div>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
    const moduleInit = ['tool'];
    function gouguInit() {
        var table = layui.table,tool = layui.tool, form = layui.form,upload = layui.upload;

        //重置
        $('body').on('click','[name="reset"]',function () {

            $('#data1').val("");
            $('#data2').val("");
            $('#data3').val("");
            $('#sdata1').val("");
            $('#sdata2').val("");
            $('#sdata3').val("");

            $('#cdata1').val("");
            $('#cdata2').val("");
            $('#cdata3').val("");
            $('#cdata4').val("");
            $('#cdata5').val("");

            $('#tdata1').val("");
            $('#tdata2').val("");
            $('#tdata3').val("");
            $('#bcz').val("");
        });
        //开始计算
        $('body').on('click','[name="start_jisuan"]',function () {
            //alert('start_jisuan');
            var url = '/webadmin/pianyidu/start_jisuan_jiyin';
            data1=$('#data1').val();
            data2=$('#data2').val();
            data3=$('#data3').val();
            sdata1=$('#sdata1').val();
            sdata2=$('#sdata2').val();
            sdata3=$('#sdata3').val();
            cdata1=$('#cdata1').val();
            cdata2=$('#cdata2').val();
            cdata3=$('#cdata3').val();
            cdata4=$('#cdata4').val();
            cdata5=$('#cdata5').val();

            tdata1=$('#tdata1').val();
            tdata2=$('#tdata2').val();
            tdata3=$('#tdata3').val();
            bcz=$('#bcz').val();

            if(data1==""){
                layer.msg("测量浓度1不为空");
                return false;
            }
            if(data2==""){
                layer.msg("测量浓度2不为空");
                return false;
            }
            if(data3==""){
                layer.msg("测量浓度3不为空");
                return false;
            }
            if(sdata1==""){
                layer.msg("测量浓度1不为空");
                return false;
            }
            if(sdata2==""){
                layer.msg("测量浓度2不为空");
                return false;
            }
            if(sdata3==""){
                layer.msg("测量浓度3不为空");
                return false;
            }
            if(tdata1==""){
                layer.msg("重复1不为空");
                return false;
            }
            if(tdata2==""){
                layer.msg("重复2不为空");
                return false;
            }
            if(tdata3==""){
                layer.msg("重复3不为空");
                return false;
            }
            if(bcz==""){
                layer.msg("标称值不为空");
                return false;
            }
            $.ajax({
                type : "POST",
                url  : url,
                data: {data1: data1, data2: data2, data3: data3,sdata1: sdata1, sdata2: sdata2,sdata3: sdata3,cdata1: cdata1,cdata2: cdata2,cdata3: cdata3,cdata4: cdata4,cdata5: cdata5,tdata1: tdata1,tdata2: tdata2,tdata3: tdata3,bcz:bcz},
                error: function(request) {
                    alert("服务器繁忙, 请联系管理员!");
                    return;
                },
                success: function(result) {
                    console.log(result);
                    $('#results').empty().html(result);
                }
            });
        });

        $('body').on('click','[name="export_data"]',function () {
            console.log('export_data');
            var url = '/webadmin/pianyidu/export_data_sys';
            data1=$('#data1').val();
            data2=$('#data2').val();
            data3=$('#data3').val();
            sdata1=$('#sdata1').val();
            sdata2=$('#sdata2').val();
            sdata3=$('#sdata3').val();
            if(data1==""){
                layer.msg("重复1不为空");
                return false;
            }
            if(data2==""){
                layer.msg("重复2不为空");
                return false;
            }
            if(data3==""){
                layer.msg("重复3不为空");
                return false;
            }
            if(sdata1==""){
                layer.msg("重复1不为空");
                return false;
            }
            if(sdata2==""){
                layer.msg("重复2不为空");
                return false;
            }
            if(sdata3==""){
                layer.msg("重复3不为空");
                return false;
            }
            $.ajax({
                type : "POST",
                url  : url,
                data: {data1: data1, data2: data2, data3: data3,sdata1: sdata1, sdata2: sdata2,sdata3: sdata3},
                error: function(request) {
                    alert("服务器繁忙, 请联系管理员!");
                    return;
                },
                success: function(result) {
                    window.location.href = result.downloadurl;
                }
            });
        });

    }
</script>
{/block}
<!-- /脚本 -->
